﻿-- Function: GuardarCliente(integer, character, character,character, integer,integer,integer,character,character,character, integer)

-- DROP FUNCTION GuardarCliente(integer, character, character,character, integer,integer,integer,character,character,character, integer)

CREATE OR REPLACE FUNCTION GuardarCliente(integer, character, character,character, integer,integer,integer,character,character,character, CHARACTER, integer)
  RETURNS integer AS
$BODY$

DECLARE
	NumCliente		ALIAS FOR $1;
	Nombre 			ALIAS FOR $2;
	ApellidoP		ALIAS FOR $3;
	ApellidoM		ALIAS FOR $4;
	Estado			ALIAS FOR $5;
	Municipio		ALIAS FOR $6;
	Colonia			ALIAS FOR $7;
	Telefono		ALIAS FOR $8;
	Celular			ALIAS FOR $9;
	RFC			ALIAS FOR $10;
	Email			ALIAS FOR $11;
	Tipo			ALIAS FOR $12;
	
BEGIN
	insert into caclientes(numcliente,nombre,apellidop,apellidom,estado,municipio,colonia,telefono,celular,rfc,email,tipo) values(NumCliente,Nombre,ApellidoP,ApellidoM,Estado,Municipio,Colonia,Telefono,Celular,RFC,Email,Tipo);
	return 1;
END;
$BODY$
  LANGUAGE plpgsql VOLATILE
